#pragma once

#include "ReaderThread.h"
#include "DispatcherThread.h"
#include "WMarkBuffer.h"
#include "watermark_common.h"

namespace android {
class DispatcherThread;
class ReaderThread;
class WatermarkManager {
public:

    static WatermarkManager* getInstance();
    void startInput();
    void stopInput();
    void notifyDataReady();
    void setWaterMarkResultCallback(WaterMarkResult *callback) {mResultCallback = callback;}
    void onDispatcherResult(WMarkBuffer *wMarkBuf);

private:
    WatermarkManager();
    ~WatermarkManager();
    WaterMarkResult *mResultCallback = nullptr;

private:
    int mDisplayX;
    int mDisplayY;
    sp<ReaderThread> mReader;
    sp<DispatcherThread> mDispatcher;
    BufferQueue<WMarkBuffer>* mBufferQueue;

    static WatermarkManager* mSingleton;
};

} //namespace

